//
//  ZZListDemoViewController.m
//  ZZNetWorker_Example
//
//  Created by ZengLiZhi on 2024/3/25.
//  Copyright © 2024 zenglizhi. All rights reserved.
//

#import "ZZListDemoViewController.h"
#import "ZZNetWorker.h"
#import "DataModel1.h"

@interface ZZListDemoViewController ()

@end

@implementation ZZListDemoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    ZZNetWorker.GET
        .zz_url(@"https://v2.jinrishici.com/token")
        .zz_dataClass(DataModel1.class)
        .zz_testResponse(@{@"code":@"200",@"data":@[
                         @{@"name":@"sss1",@"data":@"testDataString1"},
                         @{@"name":@"sss2",@"data":@"testDataString2"},
                         @{@"name":@"sss3",@"data":@"testDataString3"}],
                           @"msg":@"成功"})
    .zz_completion(^(ZZNetWorkResponse<DataModel1 *> * _Nonnull response, NSError * _Nonnull error) {
        NSLog(@"%@",response.objArray);
        self.textLabel.text =[NSString stringWithFormat:@"array.count:%ld \n first.name:%@", response.objArray.count,response.objArray.firstObject.name];
    });
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
